<?php 
namespace App\Extensions;

use Illuminate\Http\Request;
use Auth;
trait AuthenticatesLogout
{
	public function logout(Request $request)
	{   //判断是前台还是后台
		$this->guard()->logout();

        $request->session()->forget($this->guard()->getName());

        $request->session()->regenerate();

        return redirect('/');
		
	}

}